﻿<%@ Page Language="C#" MasterPageFile="~/YUIAspNet.Master" AutoEventWireup="true" CodeBehind="ClientScript.aspx.cs" Inherits="YUIAspNetDemo.TabView.ClientScript" Title="Untitled Page" %>

<%@ Register Assembly="YUIAspNet" Namespace="YUIAspNet" TagPrefix="yui" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>YUIAsp.Net Controls : LiveDemo : TabView : Client side</title>
    <script type="text/javascript">
        function informSwitch(sender, args) {
            alert("Hello from tab "+args.newTab.get("label")+"!\n You're coming from "+args.prevTab.get("label")+"!");
        }
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <h4>TabView</h4>
    
    <p>Please note that the args provided to the js handler contain 2 objects: the tab you're coming from, and the tab you are on. These 2 objects are instances of the YAHOO.widget.Tab YUI class. So it's synthax might feel different.</p>
    <p>
        <yui:TabView OnClientAfterTabChange="informSwitch" ID="tab" runat="server">
            <Tabs>
                <yui:TabItem ID="tab1" runat="server"  Text="Tab 1">
                    <ContentTemplate>Hello World!!!</ContentTemplate>
                </yui:TabItem>
                <yui:TabItem ID="tab2" runat="server" Active="true" Text="Default tab">
                    <ContentTemplate>this is the default tab!!!</ContentTemplate>
                </yui:TabItem>
                <yui:TabItem ID="tab3" runat="server" Text="Tab 3">
                    <ContentTemplate>this will inform you of the text</ContentTemplate>
                </yui:TabItem>
            </Tabs>
        </yui:TabView>
    </p>
</asp:Content>
